import request from "./request";
import type { AnyDataType } from "./request"
class Http {
    get<T>(url: string, data: AnyDataType = {}) {
        return request<T>({
            url,
            data,
            method: "GET"
        })
    }
    post<T>(url: string, data: AnyDataType = {}) {
        return request<T>({
            url,
            data,
            method: "POST"
        })
    }
    put<T>(url: string, data: AnyDataType = {}) {
        return request<T>({
            url,
            data,
            method: "PUT"
        })
    }
    delete<T>(url: string, data: AnyDataType = {}) {
        return request<T>({
            url,
            data,
            method: "DELETE"
        })
    }
}
export const http = new Http()